/*
 * @Descripttion:
 * @version: 1.0
 * @Author: 张泽涛
 * @LastEditors: 张泽涛
 * @LastEditTime: 2021-02-24 20:19:37
 */
export default {
  name: 'RouterView',
  render (h) {
    const route = this.$route
    let depth = 0
    this.isRouterView = true
    let parent = this.$parent
    while (parent) {
      if (parent.isRouterView) {
        depth++
      }
      parent = parent.$parent
    }
    const record = route.matched[depth]
    if (record) {
      return h(record.component)
    }
    return h()
  }
}
